package com.b.dao;

import com.b.domain.DynamicComment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DynamicCommentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(DynamicComment record);

    int insertSelective(DynamicComment record);

    DynamicComment selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(DynamicComment record);

    int updateByPrimaryKey(DynamicComment record);

    @Update("UPDATE dynamic_comment SET reply_count = reply_count + #{increment} WHERE id = #{commentId}")
    int updateReplyCount(@Param("commentId") Integer commentId, @Param("increment") int increment);

    @Select("SELECT * FROM dynamic_comment")
    List<DynamicComment> getAll();
}